<?php if (!defined('THINK_PATH')) exit();?><link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/bootstrap.min.css" />
<link rel="stylesheet" href="/Public/Admin/css/easyform.css">
<div class="row">
        <div class="top"></div>
        <div class="content complete_info">
            <ul class="nav nav-tabs" role="tablist" style="position: relative;">
                <li role="presentation" class="active"><a href="#aaa" aria-controls="aaa" role="tab" data-toggle="tab">基本信息</a></li>
                <li role="presentation"><a href="#ccc" aria-controls="ccc" role="tab" data-toggle="tab">车辆信息</a></li>
                <li role="presentation"><a href="#ddd" aria-controls="ddd" role="tab" data-toggle="tab">材料列表</a></li>
                <li role="presentation"><a href="#eee" aria-controls="eee" role="tab" data-toggle="tab">业务进度</a></li>

            </ul>
            <form id="reg_form" class="form-horizontal tab-content" role='form' action="<?php echo U('edit');?>" method="post" enctype="multipart/form-data" onsubmit="return form_validate()">
                <div class="list-block" style="display: inline;padding: 0px;position: absolute;right: 0;top: 0.5%;">
                    <?php if(($info['check_status'] == -1 and $info['status'] != 0) or $info['status'] == 9 or $info['status'] == 12 ): ?><input type="hidden" id="sub-type" name="sub-type" value="">
                    <input type="button" name="sbu_info" id="sub-btn" value="提交" class="button01"><?php endif; ?>
                    <?php if(($info['check_status'] < 0) or $info['status'] == 9 or $info['status'] == 12 ): ?><input type="button" name="save-btn" id="save-btn" value="保存" class="button01"><?php endif; ?>

                </div>
                <!--基本信息左内容区-->
                <div class="fl">
                    <div role="tabpanel" class="tab-pane box active" id="aaa">
                        <!-- <h1>基本信息<span>(标*为必填项)</span></h1> -->
                        <div class="info">
                            <ul class="info_top">
                                <li class="active">主贷人</li>
                                <li>紧急联系人</li>
                                <li>担保人</li>
                                <?php if($info["spouse_name"] !='' ): ?><li>配偶</li><?php endif; ?>
                            </ul>
                            <!--主贷人信息-->
                            <div class="list-block base-info">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">客户编号</label>
                                    <input type="text" id="form-field-1" class="bgCcc myCss col-xs-10 col-sm-2" name="entry_no" value="<?php echo ($info["entry_no"]); ?>" readonly >
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">业务员</label>
                                    <input type="text" id="form-field-2" class="bgCcc myCss col-xs-10 col-sm-2"  name="admin_name" value=<?php echo ($info["admin_name"]); ?> readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-3">所在部门</label>
                                    <input type="text" id="form-field-3" class="bgCcc myCss col-xs-10 col-sm-2" name="department_name" value="<?php echo ($info["department_name"]); ?>" readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-4">业务来源</label>
                                    <select name="service_source" class="myCss col-xs-10 col-sm-2">
                                        <?php if(is_array($serviceSourceItems)): foreach($serviceSourceItems as $key=>$ss): if($key == $info['service_source']): ?><option value=<?php echo ($key); ?> selected><?php echo ($ss); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($ss); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                </div>

                                <!-- <div class="form-group">
                                </div> -->

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-5">经销商类别</label>
                                    <select name="distributor_type" class="myCss col-xs-10 col-sm-2" id="form-field-5">
                                        <?php if(is_array($distributorItems)): foreach($distributorItems as $key=>$ss): if($key == $info['distributor_type']): ?><option value=<?php echo ($key); ?> selected><?php echo ($ss); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($ss); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right"  placeholder="请输入经销商" for="form-field-6">经销商</label>
                                    <input type="text" id="form-field-6" class="myCss col-xs-10 col-sm-2" name="dealer_name" placeholder="请输入经销商名称" value=<?php echo ($info["dealer_name"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-7">合作等级</label>
                                    <input data-easyform="null;" data-message="" data-easytip="position:top;class:easy-red;" type="text" placeholder="请输入合作等级" id="form-field-7" class="bgCcc myCss col-xs-10 col-sm-2" name="cooperation_level" value=<?php echo ($info["cooperation_level"]); ?> >
                                    <label class="col-sm-1 control-label no-padding-right" for="user_name">姓名</label>
                                    <input type="text" id="user_name" class="bgCcc myCss col-xs-10 col-sm-2" name="user_name" value=<?php echo ($info["user_name"]); ?> readonly>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-9">性别</label>
                                    <label class="col-xs-10 col-sm-1">男<input disabled="true" type="radio" value=1 name="sex" <?php echo ($info['sex'] == 1 ? 'checked' : ''); ?>></label>
                                    <label class="col-xs-10 col-sm-1">女<input disabled="true" type="radio" value=2 name="sex" <?php echo ($info['sex'] == 2 ? 'checked' : ''); ?>></label>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-10">婚否</label>
                                    <select name="marital_status" id="form-field-10" class="myCss col-xs-10 col-sm-2">
                                        <?php if(is_array($maritalStatusItems)): foreach($maritalStatusItems as $key=>$v): if($key == $info['marital_status']): ?><option value=<?php echo ($key); ?> selected><?php echo ($v); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($v); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-14">身份证号</label>
                                    <input type="text" id="form-field-14" class="bgCcc myCss col-xs-10 col-sm-2" name="identity_no" value=<?php echo ($info["identity_no"]); ?> readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-11">出生年月</label>
                                    <input type="date" id="form-field-11" class="bgCcc myCss col-xs-10 col-sm-2" name="birth_year_month" value=<?php echo ($info["birth_year_month"]); ?> readonly>
                                </div>

                                <div class="form-group">
                                     <label class="col-sm-1 control-label no-padding-right" for="form-field-12">年龄</label>
                                    <input type="number" id="form-field-12" class="bgCcc myCss col-xs-10 col-sm-2" name="age" value=<?php echo ($info["age"]); ?> readonly>
                                     <label class="col-sm-1 control-label no-padding-right" for="form-field-13">手机号</label>
                                    <input type="number" id="form-field-13" class="bgCcc myCss col-xs-10 col-sm-2" name="telephone" value=<?php echo ($info["telephone"]); ?> readonly>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="address">户籍</label>
                                    <div data-toggle="distpicker" id="household-registration">
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="home_province"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="home_city"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="home_district"></select>
                                        <input data-easyform="real-time;" data-message="请填写详细的户籍地址" data-easytip="position:top;class:easy-red;" placeholder="请输入户籍地址" style="margin-right: 15px;" id="home_address" class="myCss col-xs-10 col-sm-3" type="text" name="address" value=<?php echo ($info["address"]); ?>>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="now_address">现居住地</label>
                                    <div data-toggle="distpicker" id="now-address">
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="now_province"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="now_city"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="now_district"></select>
                                        <input data-easyform="real-time;" data-message="请填写现居住地地址" data-easytip="position:top;class:easy-red;" style="margin-right: 15px;" id="now_address" class="myCss col-xs-10 col-sm-3" type="text" name="now_address" placeholder="请输入现居地址" value=<?php echo ($info["now_address"]); ?>>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-20">房屋类型</label>
                                    <select name="house_type" class="myCss col-xs-10 col-sm-2" id="form-field-20">
                                        <?php if(is_array($houseTypeItems)): foreach($houseTypeItems as $key=>$val): if($key == $info['house_type']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-19">学历</label>
                                    <select name="education" class="myCss col-xs-10 col-sm-2" id="form-field-19">
                                        <?php if(is_array($educationItems)): foreach($educationItems as $key=>$val): if($key == $info['education']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="work_company">工作单位</label>
                                    <input data-easyform="real-time;" data-message="请填写工作单位" data-easytip="position:top;class:easy-red;" type="text" id="work_company" placeholder="工作单位" class="myCss col-xs-10 col-sm-3" name="work_company" value="<?php echo ($info["work_company"]); ?>">
                                </div>

                                <div class="form-group">

                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-22">工作年限</label>
                                    <select name="work_life" class="myCss col-xs-10 col-sm-2" id="form-field-22">
                                        <?php if(is_array($workYearItems)): foreach($workYearItems as $key=>$val): if($key == $info['work_life']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right">单位电话</label>
                                    <input data-easyform="number;real-time;" data-message="请填写合法的区号" data-easytip="position:top;class:easy-red;" style="margin-right: 15px;width: 80px;" class="myCss  col-xs-10 col-sm-2" placeholder="区号" type="text" id="area_code" name="area_code" value=<?php echo ($info["area_code"]); ?>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input data-easyform="number;real-time;" data-message="请填写正确的固定电话" data-easytip="position:top;class:easy-red;" class="myCss col-xs-10 col-sm-2" placeholder="固定电话" type="text" id="company_tel" name="company_tel" value=<?php echo ($info["company_tel"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-24">单位地址</label>
                                    <div data-toggle="distpicker" id="distpicker">
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="province"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="city"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="district"></select>
                                        <input data-easyform="real-time;" data-message="请填写单位详细地址" data-easytip="position:top;class:easy-red;" style="margin-right: 15px;" id="company_address" class="myCss col-xs-10 col-sm-3" type="text" name="company_address" value="<?php echo ($info["company_address"]); ?>" placeholder="请输入单位地址">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-left">单位性质</label>
                                    <select name="company_nature" class="myCss col-xs-10 col-sm-2">
                                        <?php if(is_array($companyNatureItems)): foreach($companyNatureItems as $key=>$val): if($key == $info['company_nature']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>

                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="company_office">职务职位</label>
                                    <input data-easyform="real-time;" data-message="请填写职位" data-easytip="position:top;class:easy-red" class="myCss col-xs-10 col-sm-2" type="text" placeholder="请输入职务职位" id="company_office" name="company_office" value=<?php echo ($info["company_office"]); ?> >
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-21">月收入</label>
                                    <input data-easyform="money;real-time;" data-message="您的月收入有问题" data-easytip="position:top;class:easy-red" type="text" id="month_income" class="myCss col-xs-10 col-sm-2" placeholder="请输入月收入" name="month_income" value="<?php echo ($info["month_income"]); ?>" id="form-field-21">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">备注</label>
                                    <input data-easyform="real-time;" data-message="请备注该贷款人的信息" data-easytip="position:top;class:easy-red" type="text" id="note" class="myCss col-xs-10 col-sm-2" placeholder="请输入备注信息"  name="note" value=<?php echo ($info["note"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-left" for="form-field-15">还款卡问题</label>
                                    <select name="loan_question" class="myCss col-xs-10 col-sm-2">
                                        <?php if(is_array($creditQ)): foreach($creditQ as $key=>$val): if($key == $info['loan_question']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="answer">答案</label>
                                    <input data-easyform="real-time;" data-message="答案不能为空" data-easytip="position:top;class:easy-red" class="myCss col-xs-10 col-sm-2" id="answer" type="text" name="answer" placeholder="请输入还款卡答案" value=<?php echo ($info["answer"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="refund_address">还款卡地址</label>
                                    <input data-easyform="real-time;" data-message="还款卡地址不能为空" data-easytip="position:top;class:easy-red" class="myCss col-xs-10 col-sm-5" type="text" id="refund_address" name="refund_address" placeholder="请输入还款卡地址" value=<?php echo ($info["refund_address"]); ?>>
                                </div>

                                <div class="item col-50">
                                    <label>调查情况分析:</label>
                                    <textarea class="form-control" name="survey_note" cols="100" id="survey_note" rows="3" placeholder="请输入调查情况分析"><?php echo ($info["survey_note"]); ?></textarea>
                                </div>
                            </div>
                            <!--紧急联系人-->
                            <div class="list-block urgent-contactor" style="display: none;">
                                <div class="col-33">
                                    <input id="user-id" type="hidden" name="user_id" value=<?php echo ($info["id"]); ?>>
                                    <input id="user-status" type="hidden" name="status" value=<?php echo ($info["status"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="no-padding-left col-sm-1 control-label no-padding-right" for="urgent_user_name1">姓名</label>
                                    <input type="hidden" name="urgent_id1" value=<?php echo ($contactors["0"]["id"]); ?>>
                                    <input data-easyform="real-time;" data-message="请输入紧急联系姓名" data-easytip="position:top;class:easy-red" type="text" id="urgent_user_name1" class="myCss col-xs-10 col-sm-1" name="urgent_user_name1" placeholder="紧急联系人姓名" value="<?php echo ($contactors["0"]["user_name"]); ?>">
                                    <label class="no-padding-left col-sm-1 control-label no-padding-right" for="form-field-4">关系</label>
                                    <select name="relationship1" class="myCss col-xs-10 col-sm-1">
                                        <?php if(is_array($relationship)): foreach($relationship as $key=>$val): if($key == $contactors[0]['relationship']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right">手机号码</label>
                                    <input data-easyform="telephone; real-time;" data-message="手机号格式不正确" data-easytip="position:top;class:easy-red" type="text" id="urgent_tel1" class="myCss col-xs-10 col-sm-3" name="urgent_tel1"  placeholder="请输入手机号码" value=<?php echo ($contactors["0"]["telephone"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="no-padding-left col-sm-1 control-label no-padding-right">姓名</label>
                                    <input type="hidden" name="urgent_id2" value=<?php echo ($contactors["1"]["id"]); ?>>
                                    <input data-easyform="real-time;" data-message="请输入紧急联系姓名" data-easytip="position:top;class:easy-red" type="text" id="urgent_user_name2" class="myCss col-xs-10 col-sm-1" name="urgent_user_name2"  placeholder="紧急联系人姓名" value=<?php echo ($contactors["1"]["user_name"]); ?>>
                                    <label class="no-padding-left col-sm-1 control-label no-padding-right" style="font-size: 12px;">关系</label>
                                    <select name="relationship2" class="myCss col-xs-10 col-sm-1">
                                        <?php if(is_array($relationship)): foreach($relationship as $key=>$val): if($key == $contactors[1]['relationship']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right">手机号码</label>
                                    <input data-easyform="telephone;real-time" data-message="手机号格式不对" data-easytip="position:top;class:easy-red" type="text" id="urgent_tel2" class="myCss col-xs-10 col-sm-3" name="urgent_tel2"  placeholder="请输入手机号码" value=<?php echo ($contactors["1"]["telephone"]); ?>>
                                </div>
                            </div>
                            <!--配偶-->
                            <div class="list-block spouse" style="display: none;">
                                <div class="col-33">
                                    <input type="hidden" name="user_id" value=<?php echo ($info["id"]); ?>>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">配偶姓名</label>
                                    <input data-easyform="real-time" data-message="配偶姓名不能为空" data-easytip="position:top;class:easy-red" type="text" id="spouse_name" class="myCss col-xs-10 col-sm-2" name="spouse_name" value="<?php echo ($info["spouse_name"]); ?>" readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">身份证号</label>
                                    <input  data-easyform="real-time" data-message="请输入配偶身份证" data-easytip="position:top;class:easy-red"  type="text" id="spouse_identity_no" class="myCss col-xs-10 col-sm-2" name="spouse_identity_no" value="<?php echo ($info["spouse_identity_no"]); ?>" readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">年龄</label>
                                    <input type="text" id="spouse_age" class="myCss col-xs-10 col-sm-2"  name="spouse_age" value=<?php echo ($info["spouse_age"]); ?> readonly>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-19">学历</label>
                                    <select name="spouse_education" class="myCss col-xs-10 col-sm-2" id="form-field-19">
                                        <?php if(is_array($educationItems)): foreach($educationItems as $key=>$val): if($key == $info['spouse_education']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                        <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="spouse_address">户籍</label>
                                    <div data-toggle="distpicker" id="spouse-home">
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="spouse_home_province"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="spouse_home_city"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="spouse_home_district"></select>
                                        <input  data-easyform="real-time" data-message="配偶户籍详细地址未填写" data-easytip="position:top;class:easy-red"  style="margin-right: 15px;" id="spouse_address" class="myCss col-xs-10 col-sm-3" type="text" name="spouse_address" value=<?php echo ($info["spouse_address"]); ?>>
                                    </div>
                                </div>

                                <!--<div class="form-group">-->
                                    <!--<label class="col-sm-1 control-label no-padding-right" for="form-field-15">现居住地</label>-->
                                    <!--<div data-toggle="distpicker" id="spouse-now">-->
                                        <!--<select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="spouse_now_province"></select>-->
                                        <!--<select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="spouse_now_city"></select>-->
                                        <!--<select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="spouse_now_district"></select>-->
                                        <!--<input  data-easyform="real-time" data-message="配偶现居住地未填" data-easytip="position:top;class:easy-red"  style="margin-right: 15px;" id="form-field-16" class="myCss col-xs-10 col-sm-3" type="text" name="spouse_now_address" value=<?php echo ($info["spouse_now_address"]); ?>>-->
                                    <!--</div>-->
                                <!--</div>-->

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-20">手机号</label>
                                    <input data-easyform="number;real-time" data-message="手机号格式不对" data-easytip="position:top;class:easy-red" type="text" id="spouse_telephone" class="myCss col-xs-10 col-sm-2"  name="spouse_telephone" value=<?php echo ($info["spouse_telephone"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">工作单位</label>
                                    <input data-easyform="real-time" data-message="配偶工作单位不能为空" data-easytip="position:top;class:easy-red" type="text" id="spouse_company" class="myCss col-xs-10 col-sm-2"  name="spouse_company" value=<?php echo ($info["spouse_company"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">工作年限</label>
                                    <select name="work_life" class="myCss col-xs-10 col-sm-2" id="spouse_work_life" name="spouse_work_life" >
                                        <?php if(is_array($workYearItems)): foreach($workYearItems as $key=>$val): if($key == $info['spouse_work_life']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                                <?php else: ?>
                                                <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <!--<input data-easyform="real-time" data-message="配偶的工作年限还没填" data-easytip="position:top;class:easy-red" type="text" id="spouse_work_life" class="myCss col-xs-10 col-sm-2" name="spouse_work_life" value="<?php echo ($info["spouse_work_life"]); ?>">-->
                                    <!--<label class="col-sm-1 control-label no-padding-right" for="form-field-1">所属行业</label>-->
                                    <!--<input data-easyform="real-time" data-message="从事何行业工作" data-easytip="position:top;class:easy-red"  type="text" id="spouse_industry" class="myCss col-xs-10 col-sm-2" name="spouse_industry" value="<?php echo ($info["spouse_industry"]); ?>">-->
                                 </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-15">单位地址</label>
                                    <div data-toggle="distpicker" id="spouse-company">
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="spouse_company_province"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="spouse_company_city"></select>
                                        <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="spouse_company_district"></select>
                                        <input data-easyform="real-time" data-message="配偶单位地址为空" data-easytip="position:top;class:easy-red"  style="margin-right: 15px;" id="spouse_company_address" class="myCss col-xs-10 col-sm-3" type="text" name="spouse_company_address" value=<?php echo ($info["spouse_company_address"]); ?>>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-left">单位性质</label>
                                    <select name="spouse_company_nature" class="myCss col-xs-10 col-sm-2">
                                        <?php if(is_array($companyNatureItems)): foreach($companyNatureItems as $key=>$val): if($key == $info['spouse_company_nature']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                                <?php else: ?>
                                                <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">职务职位</label>
                                    <input data-easyform="real-time" data-message="配偶的职位为空了" data-easytip="position:top;class:easy-red" type="text" id="spouse_position" class="myCss col-xs-10 col-sm-2"  name="spouse_position" value=<?php echo ($info["spouse_position"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">月收入</label>
                                    <input data-easyform="float:10 2;real-time" data-message="请输入合法的月收入" data-easytip="position:top;class:easy-red" type="text" id="spouse_month_income" class="myCss col-xs-10 col-sm-2"  name="spouse_month_income" value=<?php echo ($info["spouse_month_income"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">备注</label>
                                    <input data-easyform="real-time" data-message="备注点什么吧" data-easytip="position:top;class:easy-red"  type="text" id="form-field-2" class="myCss col-xs-10 col-sm-2"  name="spouse_note" value=<?php echo ($info["spouse_note"]); ?>>
                                </div>
                            </div>
                            <!--担保人-->
                            <div class="list-block assure" style="display: none;">
                                <div class="col-33">
                                    <input type="hidden" name="assure_id" value=<?php echo ($assureInfo["id"]); ?>>
                                </div>
                                <table class="table  table-hover table-bordered" border="1" cellspacing="0">
                                    <tr>
                                        <th>编号</th>
                                        <th>姓名</th>
                                        <th>身份证号</th>
                                        <th>操作</th>
                                    </tr>

                                    <?php if(is_array($assureList)): $i = 0; $__LIST__ = $assureList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$assure): $mod = ($i % 2 );++$i;?><tr>
                                            <td><?php echo ($assure["id"]); ?></td>
                                            <td><?php echo ($assure["user_name"]); ?></td>
                                            <td><?php echo ($assure["identity_no"]); ?></td>
                                            <td class="my-assure" id="assure<?php echo ($assure["id"]); ?>" data-id=<?php echo ($assure["id"]); ?> data-toggle="modal" data-target="#showAssure"><a target="_blank" href=<?php echo U("editAssure?assure_id=".$assure["id"]);?>>查看&编辑</a></td>
                                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane box" id="bbb">
                        <!-- <h1>垫款信息<span>(标*为必填项)</span></h1> -->

                    </div>

                    <div role="tabpanel" class="tab-pane box" id="ccc">
                        <!-- <h1>车辆消息<span>(标*为必填项)</span></h1> -->
                        <input class="required" type="hidden" name="car_info_id" value=<?php echo ($carInfo["id"]); ?>>
                        <input id="bank_rate" type="hidden" name="bank_rate" value=<?php echo ($bank_rule["rate"]); ?>>
                        <input id="bank_id" type="hidden" name="bank_id" value=<?php echo ($info["loan_bank_id"]); ?>>
                        <div class="list-block">

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-3">业务类型</label>
                                <select  class="myCss col-xs-10 col-sm-2" readonly><!-- bussiness_type去除-->
                                    <?php if(is_array($carFirmItems)): foreach($carFirmItems as $key=>$val): if($key == $carInfo['business_type']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4">车辆类型</label>
                                <select name="car_type" class="myCss col-xs-10 col-sm-2">
                                    <?php if(is_array($carTypeItems)): foreach($carTypeItems as $key=>$val): if($key == $carInfo['car_type']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-3">车辆性质</label>
                                <select name="models_form" id="models_form" class="myCss col-xs-10 col-sm-2" readonly>
                                    <?php if(is_array($carModelItems)): foreach($carModelItems as $key=>$val): if($key == $carInfo['models_form']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for=“form-field-4">汽车品牌</label>
                                <select name="brand_id" class="myCss col-xs-10 col-sm-2">
                                    <?php if(is_array($carBrand)): foreach($carBrand as $key=>$val): if($val['brand_id'] == $carInfo['brand_id']): ?><option value=<?php echo ($val["brand_id"]); ?> selected><?php echo ($val["brand_name"]); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($val["brand_id"]); ?>><?php echo ($val["brand_name"]); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-3">汽车系列</label>
                                <select class="myCss col-xs-10 col-sm-2" name="car_series_id" id="car_series_id"><option value="<?php echo ($carInfo["car_series_id"]); ?>"><?php echo ($carInfo["car_series_name"]); ?></option></select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4">汽车车型</label>
                                <select class="myCss col-xs-10 col-sm-2" name="car_form_id" id="car_form_id"><option value="<?php echo ($carInfo["car_form_id"]); ?>"><?php echo ($carInfo["type_name"]); ?></option></select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">座位数</label>
                                <input readonly type="text" id="seat_num" class="bgCcc myCss col-xs-10 col-sm-2" name="seat_no" value="<?php echo ($carInfo["seat_no"]); ?>">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">指导价</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="guide_price" type="text" name="guide_price" value=<?php echo ($carInfo["guide_price"]); ?>>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">销售价格</label>
                                <input id="sale_price" type="number" name="sale_price" class="myCss col-xs-10 col-sm-2"  placeholder="请输入销售价格" value=<?php echo ($carInfo["sale_price"]); ?> >
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">上牌地</label>
                                <select name="license_area" id="licenseList" class="myCss col-xs-10 col-sm-2">
                                    <?php if(is_array($licenseList)): foreach($licenseList as $key=>$val): if($val['address_name'] == $carInfo['license_area']): ?><option value=<?php echo ($val["address_name"]); ?> data-license=<?php echo ($val["is_province"]); ?> selected><?php echo ($val["address_name"]); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($val["address_name"]); ?>><?php echo ($val["address_name"]); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">上牌类型</label>
                                <select name="license_type" id="license_type" class="myCss col-xs-10 col-sm-2" readonly>
                                    <?php if(is_array($onCardItems)): foreach($onCardItems as $key=>$val): if($key == $carInfo['license_type']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                    <?php else: ?>
                                        <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">行驶证</label>
                                <input class="myCss col-xs-10 col-sm-2" type="text" id="driving_license" name="driving_license" placeholder="请输入行驶证车主" value=<?php echo ($carInfo["driving_license"]); ?>>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">年限</label>
                                <select name="term" id="term" class="myCss col-xs-10 col-sm-2">
                                    <?php if(is_array($yearLimitItems)): foreach($yearLimitItems as $key=>$val): if($val == $carInfo['term']): ?><option value="<?php echo ($val); ?>" selected><?php echo ($val); ?></option>
                                    <?php else: ?>
                                        <option value="<?php echo ($val); ?>"><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">公司费率</label>
                                <input class="myCss col-xs-10 col-sm-2" id="company_rate" type="number" name="company_rate" placeholder="请输入公司费率" value=<?php echo ($carInfo["company_rate"]); ?>>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">小利率</label>
                                <select name="small_rate" id="smallRate" class="myCss col-xs-10 col-sm-2">
                                    <?php if(is_array($smallRateItems)): foreach($smallRateItems as $key=>$val): if($key == $carInfo['small_rate']): ?><option value=<?php echo ($key); ?> selected><?php echo ($val); ?></option>
                                            <?php else: ?>
                                            <option value=<?php echo ($key); ?>><?php echo ($val); ?></option><?php endif; endforeach; endif; ?>
                                </select>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">签约首付款</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="sign_first_payment" type="number" name="sign_first_payment" placeholder="自动计算" value=<?php echo ($carInfo["sign_first_payment"]); ?>>
                                <label class="col-sm-1 control-label no-padding-right">签约首付比例</label>
                                <!--<div class="input-group">-->
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2"  id="sign_first_pay_proportion" type="text" placeholder="小于100的小数" name="sign_first_pay_proportion" value=<?php echo ($carInfo["sign_first_pay_proportion"]); ?>>
                                <!--</div>-->
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">实际首付款</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="real_first_payment" type="number" name="real_first_payment" placeholder="自动计算" value=<?php echo ($carInfo["real_first_payment"]); ?> >
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">实际首付比例</label>

                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="real_first_pay_proportion" type="text" placeholder="小于100的小数" name="real_first_pay_proportion" value=<?php echo ($carInfo["real_first_pay_proportion"]); ?>>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">签约贷款额</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="sign_loan_quota" type="number" name="sign_loan_quota" placeholder="自动计算" value=<?php echo ($carInfo["sign_loan_quota"]); ?>>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">签约贷款额比例</label>

                                <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="sign_loan_proportion" type="text" placeholder="小于100的小数" name="sign_loan_proportion" value=<?php echo ($carInfo["sign_loan_proportion"]); ?> >

                                <label class="col-sm-1 control-label no-padding-right">实际贷款额</label>
                                <input data-easyform="float:10 2;real-time" data-message="实际贷款额必填" data-easytip="position:top;class:easy-red" class="myCss col-xs-10 col-sm-2" id="real_loan_quota" type="number" name="real_loan_quota" placeholder="请输入实际贷款额" value=<?php echo ($carInfo["real_loan_quota"]); ?>>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">实际贷款比例</label>
                                    <input readonly class="bgCcc myCss col-xs-10 col-sm-2" id="real_loan_proportion" 0type="text" placeholder="小于100的小数" name="real_loan_proportion" value=<?php echo ($carInfo["real_loan_proportion"]); ?>>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">月还款</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-1"  id="month_repayment" type="number" name="month_repayment" placeholder="自动计算" value=<?php echo ($carInfo["month_repayment"]); ?>>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">还款总额</label>
                                <input readonly class="bgCcc myCss col-xs-10 col-sm-1" id="repayment_total" type="number" name="repayment_total" placeholder="自动计算" value=<?php echo ($carInfo["repayment_total"]); ?> >

                                <label class="col-sm-1 control-label no-padding-right">佣金</label>
                                <input data-easyform="float:10 2;real-time" data-message="佣金未填" data-easytip="position:top;class:easy-red" id="commission" class=" myCss col-xs-10 col-sm-1"  placeholder="请输入佣金比例" type="number" name="commission" value=<?php echo ($carInfo["commission"]); ?>>

                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">车商</label>
                                <input  data-easyform="float:10 2;real-time" data-message="车商佣金比例不能为空" data-easytip="position:top;class:easy-red" id="car-dealer" placeholder="请输入车商比例" class=" myCss col-xs-10 col-sm-1" type="text" name="car_dealer" value=<?php echo ($carInfo["car_dealer"]); ?> >


                                <label class="col-sm-1 control-label no-padding-right">先返</label>
                                    <input data-easyform="float:10 2;real-time" data-message="个人佣金比例不能为空" data-easytip="position:top;class:easy-red" id="person" placeholder="请输入先返比例" class=" myCss col-xs-10 col-sm-1" type="text" name="person" value=<?php echo ($carInfo["person"]); ?>>

                                <label class="col-sm-1 control-label no-padding-right">车返</label>
                                    <input data-easyform="float:10 2;real-time" data-message="车返佣金比例不能为空" data-easytip="position:top;class:easy-red" id="car_dealer_commission" placeholder="请输入车返比例" class=" myCss col-xs-10 col-sm-1" type="text" name="car_dealer_commission" value=<?php echo ($carInfo["car_dealer_commission"]); ?>>

                            </div>

                            <!--<div class="list-block" id="advance-info">-->
                                <input class="required" type="hidden" name="advance_id" value=<?php echo ($advanceInfo["id"]); ?>>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">按揭服务费</label>
                                    <input type="text" id="add1" class="myCss col-xs-10 col-sm-2" name="server_fee" placeholder="请输入按揭服务费" value=<?php echo ($advanceInfo["server_fee"]); ?>>

                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">公证抵押费</label>
                                    <input type="text" id="add2" class="myCss col-xs-10 col-sm-2"  name="mortgage_fee" placeholder="请输入公证抵押费" value=<?php echo ($advanceInfo["mortgage_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">履约保证金</label>
                                    <input type="text" id="add3" class="myCss col-xs-10 col-sm-2" name="performance_fee" placeholder="请输入履约保证金" value=<?php echo ($advanceInfo["performance_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">上牌押金</label>
                                    <input type="text" id="add4" class="myCss col-xs-10 col-sm-2"  name="card_on_deposit" placeholder="请输入上牌押金" value=<?php echo ($advanceInfo["card_on_deposit"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">担保费</label>
                                    <input type="text" id="add5" class="myCss col-xs-10 col-sm-2" name="guarantee_fee" placeholder="请输入担保费" value=<?php echo ($advanceInfo["guarantee_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">上牌费</label>
                                    <input type="text" id="add6" class="myCss col-xs-10 col-sm-2"  name="card_on_fee" placeholder="请输入上牌费" value=<?php echo ($advanceInfo["card_on_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">手续费</label>
                                    <input type="text" id="add7" class="myCss col-xs-10 col-sm-2" name="counter_fee"  placeholder="请输入手续费" value=<?php echo ($advanceInfo["counter_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">评估费</label>
                                    <input type="text" id="add8" class="myCss col-xs-10 col-sm-2"  name="assess_fee"  placeholder="请输入评估费" value=<?php echo ($advanceInfo["assess_fee"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">GPS费用</label>
                                    <input type="text" id="add9" class="myCss col-xs-10 col-sm-2" name="gps_fee"  placeholder="请输入GPS费用" value=<?php echo ($advanceInfo["gps_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">责信险</label>
                                    <input type="text" id="add10" class="myCss col-xs-10 col-sm-2"  name="liability_insurance"  placeholder="请输入责信险" value=<?php echo ($advanceInfo["liability_insurance"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">参融保险费</label>
                                    <input type="text" id="add11" class="myCss col-xs-10 col-sm-2" name="finance_safe_fee"  placeholder="请输入参融保险费" value=<?php echo ($advanceInfo["finance_safe_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">参融购置税</label>
                                    <input type="text" id="add12" class="myCss col-xs-10 col-sm-2"  name="finance_buy_fee"  placeholder="请输入参融购置税" value=<?php echo ($advanceInfo["finance_buy_fee"]); ?>>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">参融装潢费</label>
                                    <input type="text" id="add13" class="myCss col-xs-10 col-sm-2" name="finance_decorate_fee"  placeholder="请输入参融装潢费" value=<?php echo ($advanceInfo["finance_decorate_fee"]); ?>>
                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-2">其他费用</label>
                                    <input type="text" id="add24" class="myCss col-xs-10 col-sm-2"  name="other_fee"  placeholder="请输入其他费用" value=<?php echo ($advanceInfo["other_fee"]); ?>>

                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-1">合计</label>
                                    <input type="text" id="total-fee" class="myCss col-xs-10 col-sm-2" name="total_fee" placeholder="自动计算合计金额" value="<?php echo ($advanceInfo["total_fee"]); ?>" readonly>
                                </div>
                            </div>
                        <!--</div>-->

                    </div>
            </form>

                    <div role="tabpanel" class="tab-pane box" id="ddd">
                    <!-- <h1>材料列表</h1> -->
                    <div class="list-block">
                        <div style="display: flex;justify-content:flex-start;flex-wrap: wrap;">
                            <div class=""></div>

                            <div class="tabright">
                                <div class="convent_choice">
                                    <div class="andArea">
                                        <a href="<?php echo ($info["identity_photo_pros"]); ?>" target="_blank"><img src="<?php echo ($info["identity_photo_pros"]); ?>"></a>
                                    </div>
                                </div>
                                <div>
                                    <div class="filePicker">身份证正面</div>
                                </div>
                            </div>

                            <div class="tabright">
                                <div class="convent_choice">
                                    <div class="andArea">
                                        <a href="<?php echo ($info["identity_photo_cons"]); ?>" target="_blank"><img src="<?php echo ($info["identity_photo_cons"]); ?>"></a>
                                    </div>
                                </div>
                                <div>
                                    <div class="filePicker">身份证反面</div>
                                </div>
                            </div>
                            <div class="tabright">
                                <div class="convent_choice">
                                    <div class="andArea">
                                        <a href="<?php echo ($info["credit_authorize_photo"]); ?>" target="_blank"><img src="<?php echo ($info["credit_authorize_photo"]); ?>"></a>
                                    </div>
                                </div>
                                <div>
                                    <div class="filePicker">征信授权书</div>
                                </div>
                            </div>
                            <div class="tabright">
                                <div class="convent_choice">
                                    <div class="andArea">
                                        <a href="<?php echo ($info["credit_authorize_up"]); ?>" target="_blank"><img src="<?php echo ($info["credit_authorize_up"]); ?>"></a>
                                    </div>
                                </div>
                                <div>
                                    <div class="filePicker">征信授权书抬头照</div>
                                </div>
                            </div>

                            <?php if($info["spouse_name"] != null): ?><div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($info["spouse_id_photo_pros"]); ?>" target="_blank"><img src="<?php echo ($info["spouse_id_photo_pros"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">身份证正面</div>
                                    </div>
                                </div>
                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($info["spouse_id_photo_cons"]); ?>" target="_blank"><img src="<?php echo ($info["spouse_id_photo_cons"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">身份证反面</div>
                                    </div>
                                </div>
                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($info["spouse_credit_photo"]); ?>" target="_blank"><img src="<?php echo ($info["spouse_credit_photo"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">征信授权书</div>
                                    </div>
                                </div>
                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($info["spouse_credit_up"]); ?>" target="_blank"><img src="<?php echo ($info["spouse_credit_up"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">征信授权书抬头照</div>
                                    </div>
                                </div><?php endif; ?>

                            <?php if(is_array($assureInfo)): $i = 0; $__LIST__ = $assureInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$assure_id): $mod = ($i % 2 );++$i;?><div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($assure_id["assure_id_photo_pros"]); ?>" target="_blank"><img src="<?php echo ($assure_id["assure_id_photo_pros"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">身份证正面</div>
                                    </div>
                                </div>

                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($assure_id["assure_id_photo_cons"]); ?>" target="_blank"><img src="<?php echo ($assure_id["assure_id_photo_cons"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">身份证反面</div>
                                    </div>
                                </div>
                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($assure_id["assume_credit_photo"]); ?>" target="_blank"><img src="<?php echo ($assure_id["assume_credit_photo"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">征信授权书</div>
                                    </div>
                                </div>
                                <div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <a href="<?php echo ($assure_id["credit_up_photo"]); ?>" target="_blank"><img src="<?php echo ($assure_id["credit_up_photo"]); ?>"></a>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="filePicker">征信授权书抬头照</div>
                                    </div>
                                </div><?php endforeach; endif; else: echo "" ;endif; ?>

                            <?php if(is_array($needUploadFiles)): foreach($needUploadFiles as $key=>$_file_set): ?><div class="tabright">
                                    <div class="convent_choice">
                                        <div class="andArea">
                                            <div id="preview<?php echo ($_file_set["id"]); ?>">
                                                <?php if($_file_set["file_dist"] != null): if($_file_set["is_pic"] == 1): $arrFile = explode(',', $_file_set['file_dist']); if(count($arrFile) > 1){ echo '<a href="/Admin/Apply/showPic.html?pic_url='.$_file_set['file_dist'].'" target="_blank"><img src="'.$_file_set['file_dist'].'"></a>'; }else{ echo '<a href="'.$_file_set['file_dist'].'" target="_blank"><img src="'.$_file_set['file_dist'].'"></a>'; } ?>
                                                        <?php else: ?>
                                                        <video height="115"  width="150" src="<?php echo ($_file_set["file_dist"]); ?>" controls="controls"></video><?php endif; ?>
                                                    <?php else: ?>
                                                    <img src="/Public/Admin/images/preview.png"><?php endif; ?>
                                            </div>
                                        </div>
                                        <div>
                                            <div class="filePicker"><?php echo ($_file_set["file_key"]); ?></div>

                                            <input type="hidden" class="img_box<?php echo ($_file_set["id"]); ?>" name="<?php echo ($_file_set["e_file_key"]); ?>" value="<?php echo ($_file_set["file_dist"]); ?>"/>
                                            <?php if(($info['check_status'] <= -1 and $info['status'] != 0) or ($info['status'] == 9 or $info['status'] == 12 )): if($_file_set["is_pic"] == 1): ?><input accept=".jpg,.pdf,.png,.jpeg" id="fileId<?php echo ($_file_set["id"]); ?>" type="file" multiple="multiple" name="file" class="uploadA" e-file-key="<?php echo ($_file_set["e_file_key"]); ?>" file-key=<?php echo ($_file_set["file_key"]); ?> data="<?php echo ($_file_set["id"]); ?>" style="opacity: 0;" />
                                                <?php else: ?>
                                                    <input accept=".mp4,.mov" id="fileId<?php echo ($_file_set["id"]); ?>" type="file" multiple="multiple" name="file" class="uploadA" e-file-key="<?php echo ($_file_set["e_file_key"]); ?>" file-key=<?php echo ($_file_set["file_key"]); ?> data="<?php echo ($_file_set["id"]); ?>" style="opacity: 0;" /><?php endif; endif; ?>
                                        </div>
                                    </div>
                                </div><?php endforeach; endif; ?>
                            <!-- <tr>
                                <td class="bule">身份证反面&nbsp;&nbsp;&nbsp;<a class="bule" href=http://<?php echo ($_SERVER['HTTP_HOST']); ?>/Uploads/<?php echo ($info["identity_photo_cons"]); ?>>点击查看</a></td>
                                <td>预审批材料</td>
                            </tr> -->
                        </div>
                    </div>
                </div>

                    <div role="tabpanel" class="tab-pane box" id="eee">
                        <!-- <h1>业务进度</h1> -->
                        <div class="list-block">
                            <table class="">
                                <tr>
                                    <td>职位</td>
                                    <td>状态</td>
                                    <td>日期</td>
                                    <td>操作</td>
                                </tr>
                                <?php if(is_array($checkInfo)): $i = 0; $__LIST__ = $checkInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$check): $mod = ($i % 2 );++$i;?><tr>
                                        <td class="bule"><?php echo ($check["type"]); ?>-<?php echo ($check["admin_name"]); ?></td>
                                        <td>
                                            <?php switch($check["check_status"]): case "-5": ?>客户提交征信<?php break;?>
                                                <?php case "-4": ?>央行征信通过<?php break;?>
                                                <?php case "-3": ?>公检法查询通过<?php break;?>
                                                <?php case "-2": ?>同盾查询通过<?php break;?>
                                                <?php case "-1": ?>业务已提交<?php break;?>
                                                <?php case "1": switch($check["status"]): case "1": ?>渠道内勤审核通过<?php break;?>
                                                        <?php case "11": ?>渠道内勤审核待定<?php break;?>
                                                        <?php case "12": ?>渠道内勤审核驳回<?php break; endswitch; break;?>
                                                <?php case "2": switch($check["status"]): case "1": ?>区域经理审核通过<?php break;?>
                                                        <?php case "11": ?>区域经理审核待定<?php break;?>
                                                        <?php case "12": ?>区域经理审核驳回<?php break; endswitch; break;?>
                                                <?php case "3": switch($check["status"]): case "1": ?>审核助理审核通过<?php break;?>
                                                        <?php case "11": ?>审核助理审核待定<?php break;?>
                                                        <?php case "12": ?>审核助理审核驳回<?php break; endswitch; break;?>
                                                <?php case "4": switch($check["status"]): case "1": ?>审核专员审核通过<?php break;?>
                                                        <?php case "11": ?>审核专员审核待定<?php break;?>
                                                        <?php case "12": ?>审核专员审核驳回<?php break; endswitch; break;?>
                                                <?php case "5": switch($check["status"]): case "1": ?>审核主管审核通过<?php break;?>
                                                        <?php case "11": ?>审核主管审核待定<?php break;?>
                                                        <?php case "12": ?>审核主管审核驳回<?php break; endswitch; break;?>
                                                <?php case "6": switch($check["status"]): case "1": ?>审核经理审核通过<?php break;?>
                                                        <?php case "11": ?>审核经理审核待定<?php break;?>
                                                        <?php case "12": ?>审核经理审核驳回<?php break; endswitch; break;?>
                                                <?php case "7": ?>垫资申请已添加<?php break;?>
                                                <?php case "8": ?>财务助理审核通过<?php break;?>
                                                <?php case "9": ?>财务已打款<?php break;?>
                                                <?php case "10": ?>垫资资料已补录<?php break;?>
                                                <?php case "11": ?>抄单资料已确认<?php break;?>
                                                <?php case "12": ?>合同已抄单<?php break;?>
                                                <?php case "13": ?>内勤主管审核通过<?php break;?>
                                                <?php case "14": ?>合同已送行<?php break;?>
                                                <?php case "15": ?>合同由银行接收<?php break;?>
                                                <?php case "16": ?>合同从银行送回<?php break;?>
                                                <?php case "17": ?>合同已接收<?php break;?>
                                                <?php case "19": ?>合同送公证处<?php break;?>
                                                <?php case "20": ?>合同从公证处收回<?php break;?>
                                                <?php case "21": ?>公证书确认完毕<?php break;?>
                                                <?php case "22": ?>抵押资料寄至渠道<?php break;?>
                                                <?php case "23": ?>抵押资料渠道已收到<?php break;?>
                                                <?php case "24": ?>合同已快递银行<?php break;?>
                                                <?php case "25": ?>抵押资料已补录<?php break;?>
                                                <?php case "26": ?>公司资料已转交<?php break;?>
                                                <?php case "27": ?>银行已收到合同快递<?php break;?>
                                                <?php case "28": ?>归档资料已递交完毕<?php break;?>
                                                <?php case "29": ?>归档资料已送交银行<?php break;?>
                                                <?php case "30": ?>资料已归档<?php break; endswitch;?>
                                        </td>
                                        <!--    <td><?php if($check["status"] == 1): ?>审核通过<?php else: ?>审核未通过<?php endif; ?></td> -->
                                        <td><?php echo (date('Y-m-d H:i:s',$check["add_time"])); ?></td>
                                        <td>
                                            <button data-id='<?php echo ($check["id"]); ?>' class="btn btn-sm btn-default checkin"
                                                    type="button">查看
                                            </button>
                                        </td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            </table>
                        </div>
                    </div>
                </div><!--基本信息右内容区-->
        </div>
</div>
<div id="myModal" class="modal fade in" style="display: none;">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">详情页面</h4>
            </div>
            <div class="modal-body" style='height:200px;'></div>
        </div>
    </div>
</div>
<script src="http://www.jq22.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/Public/Admin/extend/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/Public/Admin/js/distpicker.data.js"></script>
<script type="text/javascript" src="/Public/Admin/js/distpicker.js"></script>
<script type="text/javascript" src="/Public/Admin/js/easyform.js"></script>
<script type="text/javascript">
    $('.my-assure').click(function(){
        var assure_id = $(this).attr('data-id');
        $.ajax({
           type: "POST",
           url: "/index.php?s=/Admin/Apply/getAssureById",
           data: "assure_id="+assure_id,
           success: function(msg){
                obj_data = $.parseJSON(msg);
                console.log(obj_data);

                $('.a-userName').html(obj_data.user_name);
                $('.a-telephone').html(obj_data.telephone);
                $('.a-idNo').html(obj_data.identity_no);

           }
        });
    });

    $('.uploadA').change(function(){
        var idValue = $(this).attr('id');
        $("#ulList").empty();
        var fp = $("#"+idValue);
        var lg = fp[0].files.length; // get length
        var items = fp[0].files;
        var fragment = "";

        if (lg > 0) {
            for (var i = 0; i < lg; i++) {
                var fileName = items[i].name; // get file name
                var fileSize = items[i].size; // get file size
                var fileType = items[i].type; // get file type

                // append li to UL tag to display File info
                fragment += "<li>" + fileName + " (<b>" + fileSize + "</b> bytes) - Type :" + fileType + "</li>";
            }

            if (fileType == 'video/mp4' || fileType == 'application/pdf') {

                 fileId     = $(this).attr('id');
                 dataID     = $(this).attr('data');
                 file_key   = $(this).attr('file-key');
                 e_file_key = $(this).attr('e-file-key');
                 user_id    = $('#user-id').val();

                $.ajaxFileUpload({
                        url:'<?php echo U("Upload/detailInfoVideo");?>',//处理图片脚本
                        type:'post',
                        secureuri: false,
                        fileElementId :fileId,//file控件id
                        dataType : 'json',
                        data: {user_id :user_id,file_key : file_key,e_file_key:e_file_key},

                        success: function (dd){
                            dd = $.parseJSON(dd);
                            console.log(dd);
                            if (dd.status == -1) {
                                alert(dd.msg);
                            }else{
                                imgContents = '<video src="'+dd.msg+'" width="100%"></video>';
                                $("#preview"+dataID).html(imgContents);
                                $(".img_box"+dataID).attr("value",dd.msg);
                            }
                        },
                        error: function(dd){
                            console.log(dd.responseText.msg);
                            dd = $.parseJSON(dd.responseText);
                            imgContents = '<video height="115" width="150" src="'+dd.msg+'" controls="controls"></video>';
                            $("#preview"+dataID).html(imgContents);
                            $(".img_box"+dataID).attr("value",dd.msg);
                        }
                    });
            }else{
                    var fileId           = $(this).attr('id');
                    var dataID           = $(this).attr('data');
                    var file_key         = $(this).attr('file-key');
                    var e_file_key       = $(this).attr('e-file-key');
                    var user_id          = $('#user-id').val();

                    var reader           = new FileReader();
                    var AllowImgFileSize = 21000000; //上传图片最大值(单位字节)（ 2 M = 2097152 B ）超过2M上传失败
                    var file             = $('#'+fileId)[0].files;
                    console.log(file);
                    var imgArr = [];
                    for(var i = 0;i <file.length;i++){
                        var base64 = null;
                        var oReader = new FileReader();
                        oReader.onload = function (e) {
                            var image = new Image();
                            image.src = e.target.result;
                            image.onload = function () {
                                var canvas = document.createElement("canvas");
                                var ctx = canvas.getContext("2d");
                                canvas.width = image.width;
                                canvas.height = image.height;
                                ctx.drawImage(this, 0, 0);
                                base64 = canvas.toDataURL("image/jpeg", 0.4);
                                imgArr.push(base64);
                                // console.log(imgArr);
                                if(i == (imgArr.length)){
                                    $.ajax({
                                        url:'<?php echo U("Upload/detailInfoLogo");?>',//处理图片脚本
                                        type:'post',
                                        dataType : 'json',
                                        data: {user_id :user_id,file_key : file_key,e_file_key:e_file_key,img_arr:imgArr},
                                        success: function (data){
                                            console.log(data);
                                            if (data.status == -1) {
                                                alert(data.msg);
                                            }else{
                                                imgContents = '<img src="'+data.msg+'" width="100%">';
                                                $("#preview"+dataID).html(imgContents);
                                                $(".img_box"+dataID).attr("value",data.msg);
                                            }
                                        },
                                        error: function(data){
                                            console.log(data);
                                        }
                                    });
                                }
                            };
                        };
                        oReader.readAsDataURL(file[i]);
                    }
            }
        }
    });

// 初始化
$(document).ready(function ()
    {
        var v = $('#reg_form').easyform();

        // $('#demo-form').easyform();

        // is_submit    是否执行提交，该值为false时，将不执行提交。
        // v.is_submit = false;
        v.is_submit = true;

        // v.submit(true);

        v.error = function (ef, i, r)
        {
            //console.log("Error事件：" + i.id + "对象的值不符合" + r + "规则");
        };

        v.success = function (ef)
        {
            console.log("成功");
            // alert("asd")
        };

        v.complete = function (ef)
        {
            console.log("完成");
        };


    });
</script>

<script type="text/javascript">

    // calculation
    $('#real_first_payment').change(function(){
        // toFixed(2)
        _tmpV = 100 * $(this).val() / $('#sale_price').val();
        $('#real_first_pay_proportion').val(_tmpV);
    });

    $('#sign_first_payment').change(function(){
        // toFixed(2)
        _tmpV = 100 * $(this).val() / $('#sale_price').val();
        $('#sign_first_pay_proportion').val(_tmpV);

        _s_l_q = $('#sale_price').val() - $(this).val();
        $('#sign_loan_quota').val(_s_l_q);

        s_l_p = 100 * _s_l_q / $('#sale_price').val();

        $('#sign_loan_proportion').val(s_l_p);
    });

    function calculate() {
        small_rate = $('#smallRate').val();
        //如果有小利率则使用下列计算公式
        if (small_rate == 1) {
            // toFixed(2)
            // 实际首付款=销售价格-实际贷款额【实际贷款额度，无字段】
            _tmpV = numSub($('#sale_price').val(), $('#real_loan_quota').val());
            $('#real_first_payment').val(_tmpV);

            // 实际首付比例：实际首付款/销售价格
            _r_l_p = ( 100 * numDiv(_tmpV, $('#sale_price').val()) ).toFixed(2)+'%';
            $('#real_first_pay_proportion').val(_r_l_p);

            // 实际贷款比例=实际贷款额/销售价格【目前页面无设计】
            loan_pro = ( 100 * numDiv($('#real_loan_quota').val(), $('#sale_price').val()) ).toFixed(2)+'%';
            $('#real_loan_proportion').val(loan_pro);


            // 签约贷款额 = 销售价格*(1+公司费率-银行利率)
            _s_l_q = Math.ceil(numMulti($('#real_loan_quota').val(), (1 + $('#company_rate').val() / 100 - $('#bank_rate').val() / 100))/100)*100;
            $('#sign_loan_quota').val(_s_l_q);

            //签约首付款：销售价格-签约贷款额
            sign_first_payment = numSub($('#sale_price').val(), _s_l_q);
            $('#sign_first_payment').val(sign_first_payment);

            // 签约首付比例
            _s_f_p_p = (100 * numDiv(sign_first_payment, $('#sale_price').val())).toFixed(2)+'%';
            $('#sign_first_pay_proportion').val(_s_f_p_p);

            // 签约贷款比例=签约贷款额/销售价格【目前页面无设计】
            _s_l_p = (100 * numDiv(_s_l_q, $('#sale_price').val())).toFixed(2)+'%';
            $('#sign_loan_proportion').val(_s_l_p);

            // 还款总额=签约贷款额*（1+银行利率）
            ret = _s_l_q*(1 + ($('#bank_rate').val()/100));

            // 月还款= 还款总额/年限
            _m_r = (ret/$('#term').val()).toFixed(2);
            $('#month_repayment').val(_m_r);

            $('#repayment_total').val(ret);
        } if(small_rate==0 ){
            // 月还款=（实际贷款额*（1+公司费率））/年限
            _m_r = numDiv(numMulti($('#real_loan_quota').val(), (1 + $('#company_rate').val() / 100 )), $('#term').val()).toFixed(2);
            $('#month_repayment').val(_m_r);

            // 还款总额=月还款*年限
            ret = numMulti($('#term').val(), _m_r);
            $('#repayment_total').val(ret);
            // toFixed(2)
            // 签约贷款额 = 销售价格/(1+银行利率)
            _s_l_q = numDiv(ret, (1 + $('#bank_rate').val() / 100)).toFixed(2);
            $('#sign_loan_quota').val(_s_l_q);
            // 实际首付款=销售价格-实际贷款额【实际贷款额度，无字段】
            _tmpV = numSub($('#sale_price').val(), $('#real_loan_quota').val());
            $('#real_first_payment').val(_tmpV);

            // 实际首付比例：实际首付款/销售价格
            _r_l_p = ( 100 * numDiv(_tmpV, $('#sale_price').val()) ).toFixed(2)+'%';
            $('#real_first_pay_proportion').val(_r_l_p);

            // 实际贷款比例=实际贷款额/销售价格【目前页面无设计】
            loan_pro = ( 100 * numDiv($('#real_loan_quota').val(), $('#sale_price').val()) ).toFixed(2)+'%';
            $('#real_loan_proportion').val(loan_pro);

            //签约首付款：销售价格-签约贷款额
            sign_first_payment = numSub($('#sale_price').val(), _s_l_q);
            $('#sign_first_payment').val(sign_first_payment);

            // 签约首付比例
            _s_f_p_p = (100 * numDiv(sign_first_payment, $('#sale_price').val())).toFixed(2)+'%';
            $('#sign_first_pay_proportion').val(_s_f_p_p);

            // 签约贷款比例=签约贷款额/销售价格【目前页面无设计】
            _s_l_p = (100 * numDiv(_s_l_q, $('#sale_price').val())).toFixed(2)+'%';
            $('#sign_loan_proportion').val(_s_l_p);
        }
    }

    //键盘触发计算公式
    $('#real_loan_quota').keyup(calculate);
    $('#sale_price').keyup(calculate);
    $('#smallRate').change(calculate);
    $('#company_rate').keyup(calculate);
    // 个人和车商相互计算
//    $('#person').change(function(){
//        _c_d = $('#commission').val() - $(this).val();
//        $('#car-dealer').val(_c_d);
//    });

    $('#car-dealer').change(function(){
        _p = $('#commission').val() - $(this).val();
        $('#person').val(_p);
    });

    $('#sign_loan_quota').change(function(){
        s_l_p = 100 * $(this).val() / $('#sale_price').val();

        $('#sign_loan_proportion').val(s_l_p);
    });
    // 还款总额=月还款*年限
    $('#month_repayment').change(function(elm) {
        product = $(this).val() * $('#term').val();
        $('#repayment_total').val(product);//.attr('disabled',true)
    });
    //更新期数时，同时更新银行利率
    $('#term').change(function () {
        term = $(this).val();
        bank_id = $('#bank_id').val();
        models_form = $('#models_form').val();
//        province= ("#license_area").find("option:selected").data("licenseList");
        province= $('#license_area option:selected').data("license");
        $.ajax({
            type: "POST",
            url: "/index.php?s=/Admin/Apply/getRate",
            data: {term :term,bank_id : bank_id,models_form:models_form,province:1},
            success: function (msg) {
                $('#bank_rate').val($.parseJSON( msg).rate);
            }
        });
        calculate();
    });


    $('.checkin').click(function(){
            obj = $(this), id = obj.data('id');
            var html = '';
            $.post('<?php echo U("Apply/check_info");?>', {id: id}, function(data){

                    html = '<p class="col-sm-6">审核人：' + data.admin_name + '</p>';
                    html += '<p class="col-sm-6">身份：' + data.type + '</p>';
                    if(data.status==0){
                      html += '<p class="col-sm-6">未通过类型：' + data.refuse_name + '</p>';
                      html += '<p class="col-sm-6">未通过原因：' + data.refuse_reason + '</p>';
                    }else{
                      html += '<p class="col-sm-6">通过意见：' + data.opinion + '</p>';
                      html += '<p class="col-sm-6">通过备注：' + data.note + '</p>';
                    }
                    $('.modal-body').html(html);
                    $('#myModal').show();
                   // $('#myModal').modal('show');
            });
        });

      $(".close").click(function(){
         $('#myModal').hide();
      });
    // 动态获取汽车系列
    $('select[name="brand_id"]').change(function(elm){
        selectedVal = $(this).val();
        $.ajax({
           type: "POST",
           url: "/index.php?s=/Admin/Apply/selectSeries",
           data: "brand_id="+selectedVal,
           success: function(msg){
            obj_data = $.parseJSON(msg);
            console.log(obj_data);

            series = $('select[name="car_series_id"]');
            series.empty();

            var html = '<option>汽车系列</option>';
            $(obj_data).each(function(i, v){
                html += '<option value="' + v.car_series_id + '">' + v.car_series_name + '</option>';
            });
            series.html(html);

           }
        });
    });

    // 车型构成
    $('select[name="car_series_id"]').change(function(elm){
        selectedVal = $(this).val();
        $.ajax({
           type: "POST",
           url: "/index.php?s=/Admin/Apply/getCarSetInfo",
           data: "car_series_id="+selectedVal,
           success: function(msg){
            obj_data = $.parseJSON(msg);
            console.log(obj_data);

            carForm = $('select[name="car_form_id"]');
            carForm.empty();

            var html = '<option>汽车车型</option>';
            $(obj_data).each(function(i, v){
                html += '<option guide-price='+v.guide_price+' seat-no='+v.seat_num+' value="' + v.type_id + '">' + v.type_name + '</option>';
            });
            carForm.html(html);
           }
        });
    });

    // 座位数 指导价
    $('select[name="car_form_id"]').change(function(elm){
        selectedVal = $(this).val();
        selectedOption = $(this).find("option:selected");

        console.log(selectedOption);
        if (selectedOption.attr('seat-no') == 'null') {
            $('#seat_num').val('暂无信息');
        } else {
            $('#seat_num').val(selectedOption.attr('seat-no'));
        }

        if (selectedOption.attr('guide-price') == 'null') {
            $('#guide_price').val('暂无信息');
        } else {
            // alert(numAdd(selectedOption.attr('guide-price'),0));
            // alert(numMulti(selectedOption.attr('guide-price'),1));
            $('#guide_price').val(numMulti(selectedOption.attr('guide-price'),1));
        }

    });

    $('#sub-btn').click(function(){
        if($("#home_address").val() == ''){
            alert('请填写户籍地址');
        }else if($("#now_address").val() == ''){
            alert('请填写现住地址');
        }else if($("#work_company").val() == ''){
            alert('请填写工作单位');
        }else if($("#area_code").val() == ''){
            alert('请填写区号');
        }else if($("#company_tel").val() == ''){
            alert('请填写固定电话');
        }else if($("#company_address").val() == ''){
            alert('请填写单位地址');
        }else if($("#company_office").val() == ''){
            alert('请填写职务职位');
        }else if($("#month_income").val() == '0.00'){
            alert('请填写月收入');
        }else if($("#answer").val() == ''){
            alert('请填写还款卡答案');
        }else if($("#refund_address").val() == ''){
            alert('请填写还款卡地址');
        }else if($("#urgent_user_name1").val() == ''){
            alert('请填写紧急联系人1姓名');
        }else if($("#urgent_tel1").val() == ''){
            alert('请填写紧急联系人1手机号');
        }else if($("#urgent_user_name1").val() == ''){
            alert('请填写紧急联系人2姓名');
        }else if($("#urgent_tel2").val() == ''){
            alert('请填写紧急联系人2手机号');
        }else if($("#car_series_id").val() == ''){
            alert('请选择汽车系列');
        }else if($("#sale_price").val() == '0.00'){
            alert('请填写销售价格');
        }else if($("#company_rate").val() == '0.00'){
            alert('请填写公司利率');
        }else if($("#real_loan_quota").val() == '0.00'){
            alert('请填写贷款额');
        }else if($("#driving_license").val() == ''){
            alert('请填写行驶证车主');
//        }else if($("#commission").val() == '0.00'){
//            alert('请填写佣金比例');
//        }else if($("#car_dealer").val() == ''){
//            alert('请填写车商比例');
//        }else if($("#person").val() == ''){
//            alert('请填写先返比例');
//        }else if($("#car_dealer_commission").val() == ''){
//            alert('请填写车返比例');
        }else if($("#spouse_name").val()!= '') {
            if ($("#spouse_address").val() == '') {
                alert('请填写配偶户籍地址')
            } else if ($("#spouse_telephone").val() == '') {
                alert('请填写配偶手机号')
            } else if ($("#spouse_company").val() == '') {
                alert('请填写配偶工作单位')
            } else if ($("#spouse_position").val() == '') {
                alert('请填写配偶职务职位')
            } else if ($("#spouse_month_income").val() == '0.00') {
                alert('请填写配偶月还款')
            }
            else{
                $("#sub-type").val(1);
                $('form')[0].submit();
//                alert('提交成功');
            }
        }
        else{
            $("#sub-type").val(1);
            $('form')[0].submit();
//            alert('提交成功');
        }

    });
    //保存按钮
    $("#save-btn").click(function(){
        $("#sub-type").val(2);
        $('form')[0].submit();
    });
    //
    $("#license_type").change(function(){
        if($(this).val()==0){
            username=$("#user_name").val();
            $("#driving_license").val(username);
        }
        else{
            $("#driving_license").val('');
        }
    });

    // 表单验证
    function form_validate()
    {
        if (!$("input[name='server_fee']").val()) {
            $("input[name='server_fee']").focus().attr('placeholder','不能为空');
        }else if (!$("input[name='mortgage_fee']").val()) {
            $("input[name='mortgage_fee']").focus();
        }else if (!$("input[name='performance_fee']").val()) {
            $("input[name='performance_fee']").focus();
        }else if (!$("input[name='card_on_deposit']").val()) {
            $("input[name='card_on_deposit']").focus();
        }else if (!$("input[name='guarantee_fee']").val()) {
            $("input[name='guarantee_fee']").focus();
        }else if (!$("input[name='card_on_fee']").val()) {
            $("input[name='card_on_fee']").focus();
        }else if (!$("input[name='counter_fee']").val()) {
            $("input[name='counter_fee']").focus();
        }else if (!$("input[name='assess_fee']").val()) {
            $("input[name='assess_fee']").focus();
        }else if (!$("input[name='gps_fee']").val()) {
            $("input[name='gps_fee']").focus();
        }else if (!$("input[name='liability_insurance']").val()) {
            $("input[name='liability_insurance']").focus();
        }else if (!$("input[name='finance_safe_fee']").val()) {
            $("input[name='finance_safe_fee']").focus();
        }else if (!$("input[name='finance_buy_fee']").val()) {
            $("input[name='finance_buy_fee']").focus();
        }else if (!$("input[name='finance_decorate_fee']").val()) {
            $("input[name='finance_decorate_fee']").focus();
        }else if (!$("input[name='other_fee']").val()) {
            $("input[name='other_fee']").focus();
        }else if (!$("input[name='total_fee']").val()) {
            $("input[name='total_fee']").focus();
        }

        return true;
    }

    $("input[id^='add']").change(function(){
        var sum=0;
        $("input[id^='add']").each(function(){
          var r = /^-?\d+$/ ;　//正整数
          if( $(this).val() !='' && isNaN($(this).val()) ){
           $(this).val("");  //正则表达式不匹配置空
          }else if($(this).val() !=''){
           sum += parseFloat($(this).val());
          }
          document.getElementById("total-fee").value=sum;
          });
    });

    // 初始化地区户籍
    $("#household-registration").distpicker({
      province: '<?php echo ($h_areaInfo["province"]); ?>',
      city: '<?php echo ($h_areaInfo["city"]); ?>',
      district: '<?php echo ($h_areaInfo["district"]); ?>'
    });

    // 初始化地区现居住地
    $("#now-address").distpicker({
      province: '<?php echo ($now_areaInfo["province"]); ?>',
      city: '<?php echo ($now_areaInfo["city"]); ?>',
      district: '<?php echo ($now_areaInfo["district"]); ?>'
    });

    // 初始化地区单位地址
    $("#distpicker").distpicker({
      province: '<?php echo ($c_areaInfo["province"]); ?>',
      city: '<?php echo ($c_areaInfo["city"]); ?>',
      district: '<?php echo ($c_areaInfo["district"]); ?>'
    });

    // 初始化配偶户籍
    $("#spouse-home").distpicker({
      province: '<?php echo ($s_h_areaInfo["province"]); ?>',
      city: '<?php echo ($s_h_areaInfo["city"]); ?>',
      district: '<?php echo ($s_h_areaInfo["district"]); ?>'
    });

    // 初始化配偶现居住地
    $("#spouse-now").distpicker({
      province: '<?php echo ($s_now_areaInfo["province"]); ?>',
      city: '<?php echo ($s_now_areaInfo["city"]); ?>',
      district: '<?php echo ($s_now_areaInfo["district"]); ?>'
    });

    // 初始化配偶单位地址
    $("#spouse-company").distpicker({
      province: '<?php echo ($s_c_areaInfo["province"]); ?>',
      city: '<?php echo ($s_c_areaInfo["city"]); ?>',
      district: '<?php echo ($s_c_areaInfo["district"]); ?>'
    });

    // 初始化担保人户籍
    $("#assure-home").distpicker({
      province: '<?php echo ($a_h_areaInfo["province"]); ?>',
      city: '<?php echo ($a_h_areaInfo["city"]); ?>',
      district: '<?php echo ($a_h_areaInfo["district"]); ?>'
    });

    // 初始化担保人现居住地
    $("#assure-now").distpicker({
      province: '<?php echo ($a_now_areaInfo["province"]); ?>',
      city: '<?php echo ($a_now_areaInfo["city"]); ?>',
      district: '<?php echo ($a_now_areaInfo["district"]); ?>'
    });

    // 初始化担保人单位地址
    $("#assure-company").distpicker({
      province: '<?php echo ($a_c_areaInfo["province"]); ?>',
      city: '<?php echo ($a_c_areaInfo["city"]); ?>',
      district: '<?php echo ($a_c_areaInfo["district"]); ?>'
    });

    // 主贷人和紧急联系人切换
    $(function(){
        $('.info_top').find('li').click(function(elm){
            cureent_index = $(this).index();
            if(cureent_index == 0){
                $('.spouse').css("display","none");
                $('.assure').css("display","none");
                $('.urgent-contactor').css("display","none");
                $('.base-info').css("display","block");
            }else if(cureent_index == 1){
                $('.spouse').css("display","none");
                $('.assure').css("display","none");
                $('.urgent-contactor').css("display","block");
                $('.base-info').css("display","none");
            }else if(cureent_index == 2){
                $('.spouse').css("display","none");
                $('.assure').css("display","block");
                $('.urgent-contactor').css("display","none");
                $('.base-info').css("display","none");
            }else if(cureent_index == 3){
                $('.spouse').css("display","block");
                $('.assure').css("display","none");
                $('.urgent-contactor').css("display","none");
                $('.base-info').css("display","none");
            }
            $(this).addClass("active").siblings("").removeClass("active");
        });
    });
</script>